package com.smartscreen.baseinfomanage.mapper;


import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.smartscreen.baseinfomanage.entity.SchoolClass;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import java.util.List;

@Mapper
public interface SchoolClassMapper extends BaseMapper<SchoolClass> {
    
    @Select("SELECT c.*, t.name as teacher_name FROM class c " +
            "LEFT JOIN teacher t ON c.homeroom_teacher_id = t.teacher_id " +
            "WHERE c.grade_id = #{gradeId}")
    List<SchoolClass> selectByGradeId(String gradeId);
}